<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="css/baseCss.css" rel="stylesheet" type="text/css" />
<link href="css/grid.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<style type="text/css">
body {
	padding: 10px;
}

table {
	margin: -1px !important;
}

td {
	border: 1px solid red;
}
</style>
</head>
<body>
	<div class="row _MT10 _MB10 clear">
		<span  class="g-6-24 _MR10"><input type="text" value="4" class="pNo"/></span>
		<span  class="g-6-24 _MR10"><input type="text" value="2" class="cNo"/></span>
		<button type="button" class="_blue _btn g-6-24 createTable"  >生成</button>
	</div>
	
	<div class="tableHere"> 
	
	</div>

</body>
<script type="text/javascript">
	$(function() {
		$(".createTable").click(function(){
			var pNo= parseInt($(".pNo").val());
			var cNo= parseInt($(".cNo").val());
			//==父级================================== 
			var pstr="<tr> <td rowspan=\""+(pNo+1)+"\">表名</td> <td colspan=\"2\">fsxxxx</td> </tr>"
			for(var i=0;i<pNo;i++){
				pstr+="<tr><td>父级类型"+i+"</td><td></td></tr>";
			}
			$(".tableHere").html("<table class=\"_table\">"+pstr+"</table>")
			//==子级===================================
			var str="";
			for (var i = 0; i < cNo; i++)
				str += "<tr><td>字段名"+i+"</td><td>filedName</td></tr>";
			var table = "<table class=\"_table\">" + str + "</table>"
			$(".tableHere table tr:gt(0)").find("td:eq(1)").css("padding", "0px").html(table);
		})
	})
</script>
</html>